package com.sneakxy.cloudbase.platform.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.sneakxy.cloudbase.platform.bean.RolePerm;
import com.sneakxy.cloudbase.platform.bean.RolePermId;
import com.sneakxy.cloudbase.platform.repository.RolePermRepository;

/**
 * 
 * @author 潜行的青衣
 * @see
 */
@Service
public class RolePermService extends BaseService<RolePerm, RolePermId, RolePermRepository> implements IRolePermService {

	/* (non-Javadoc)
	 * @see com.sneakxy.cloudbase.platform.service.IRolePermService#findPermissions(java.util.List)
	 */
	@Override
	public List<String> findPermissions(List<String> roles) {
		return this.getRepository().findPermissions(roles);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.cloudbase.platform.service.IRolePermService#deleteByPermId(java.lang.String)
	 */
	@Override
	public int deleteByPermId(String permId) {
		return this.getRepository().deleteByPermId(permId);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.cloudbase.platform.service.IRolePermService#findPermissions(java.lang.String)
	 */
	@Override
	public List<String> findPermissions(String roleId) {
		return this.getRepository().findByRoleId(roleId);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.cloudbase.platform.service.IRolePermService#deleteByRoleId(java.lang.String)
	 */
	@Override
	public int deleteByRoleId(String roleId) {
		return this.getRepository().deleteByRoleId(roleId);
	}

}
